package com.nuoniu.sibanyun.mapper.erp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.bo.UsedGradeRuleBo;
import com.nuoniu.sibanyun.entity.erp.ErpGradeRule;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author baiqiang
 * @since 2020-09-22
 */
public interface ErpGradeRuleMapper extends BaseMapper<ErpGradeRule> {

    @Select("SELECT grade_rule_level,grade_rule_str FROM ${tableName} WHERE grade_rule_level = (SELECT MAX(grade_rule_level) FROM ${tableName} WHERE company_id = #{companyId} and account_id = #{accountId} ) LIMIT 1")
    UsedGradeRuleBo getMaxRuleLevel(Integer accountId, Integer companyId,String tableName);

}
